<template>
  <div>
    <canvas ref="qrcode" />
    <el-button @click="login">登录</el-button>
  </div>
</template>

<script>
import Qrcode from 'qrcode'
import { tologin } from './api/code'
export default {
  methods: {
    async login() {
      const res = await tologin()
      console.log(res)
      Qrcode.toCanvas(this.$refs.qrcode, res.data.data, {
        width: 300,
        height: 300
      })
    }
  }
}
</script>

<style>

</style>
